from django.template import Library
from operate.models import MyBookshelf

register = Library()


@register.filter
def has_add_mybookshelf(book, user):
    c = MyBookshelf.objects.filter(book=book, user=user)
    return True if c else False
